C++
语言
标准库头文件
自立与有宿主实现
具名要求
语言支持库
概念库 (C++20)
诊断库
工具库
字符串库
容器库
迭代器库
范围库 (C++20)
算法库
数值库
本地化库
输入/输出库
文件系统库 (C++17)
正则表达式库 (C++11)
原子操作库 (C++11)
线程支持库 (C++11)
技术规范
标准库头文件
语言支持
概念
诊断
通用工具
字符串
本地化
容器
迭代器
范围
算法
数值
输入/输出
正则表达式
文件系统
线程支持
C 兼容
此头文件原作为 存在于 C 标准库。
此头文件是类型支持库的一部分,提供定宽整数类型和部分 C 数值极限接口。
类型
定义于头文件
int8_tint16_tint32_tint64_t(可选)
分别为宽度恰为 8、16、32 和 64 位的有符号整数类型无填充位并对负值使用补码(仅若实现支持该类型才提供) (typedef)
int_fast8_tint_fast16_tint_fast32_tint_fast64_t
分别为宽度至少有 8、16、32 和 64 位的最快的有符号整数类型 (typedef)
int_least8_tint_least16_tint_least32_tint_least64_t
分别为宽度至少有 8、16、32 和 64 位的最小的有符号整数类型 (typedef)
intmax_t
最大宽度的有符号整数类型 (typedef)
intptr_t(可选)
足以保有指针的有符号整数类型 (typedef)
uint8_tuint16_tuint32_tuint64_t(可选)
宽度恰为 8、16、32 和 64 位的无符号整数类型(仅若实现支持该类型才提供) (typedef)
uint_fast8_tuint_fast16_tuint_fast32_tuint_fast64_t
分别为宽度至少有 8、16、32 和 64 位的最快无符号整数类型 (typedef)
uint_least8_tuint_least16_tuint_least32_tuint_least64_t
分别为宽度至少有 8、16、32 和 64 位的最小无符号整数类型 (typedef)
uintmax_t
最大宽度的无符号整数类型 (typedef)
uintptr_t(可选)
足以保有指针的无符号整数类型 (typedef)
宏
定义于头文件
有符号整数:最小值
INT8_MININT16_MININT32_MININT64_MIN(可选)
int8_t、int16_t、int32_t、int64_t 类型对象的最小值 (宏常量)
INT_FAST8_MININT_FAST16_MININT_FAST32_MININT_FAST64_MIN
int_fast8_t、int_fast16_t、int_fast32_t、int_fast64_t 类型对象的最小值 (宏常量)
INT_LEAST8_MININT_LEAST16_MININT_LEAST32_MININT_LEAST64_MIN
int_least8_t、int_least16_t、int_least32_t、int_least64_t 类型对象的最小值 (宏常量)
INTPTR_MIN(可选)
intptr_t 类型对象的最小值 (宏常量)
INTMAX_MIN
intmax_t 类型对象的最小值 (宏常量)
有符号整数:最大值
INT8_MAXINT16_MAXINT32_MAXINT64_MAX(可选)
int8_t、int16_t、int32_t、int64_t 类型对象的最大值 (宏常量)
INT_FAST8_MAXINT_FAST16_MAXINT_FAST32_MAXINT_FAST64_MAX
int_fast8_t、int_fast16_t、int_fast32_t、int_fast64_t 类型对象的最大值 (宏常量)
INT_LEAST8_MAXINT_LEAST16_MAXINT_LEAST32_MAXINT_LEAST64_MAX
int_least8_t、int_least16_t、int_least32_t、int_least64_t 类型对象的最大值 (宏常量)
INTPTR_MAX(可选)
intptr_t 类型对象的最大值 (宏常量)
INTMAX_MAX
intmax_t 类型对象的最大值 (宏常量)
无符号整数:最大值
UINT8_MAXUINT16_MAXUINT32_MAXUINT64_MAX(可选)
uint8_t、uint16_t、uint32_t、uint64_t 类型对象的最大值 (宏常量)
UINT_FAST8_MAXUINT_FAST16_MAXUINT_FAST32_MAXUINT_FAST64_MAX
uint_fast8_t、uint_fast16_t、uint_fast32_t、uint_fast64_t 类型对象的最大值 (宏常量)
UINT_LEAST8_MAXUINT_LEAST16_MAXUINT_LEAST32_MAXUINT_LEAST64_MAX
uint_least8_t、uint_least16_t、uint_least32_t、uint_least64_t 类型对象的最大值 (宏常量)
UINTPTR_MAX(可选)
uintptr_t 类型对象的最大值 (宏常量)
UINTMAX_MAX
uintmax_t 类型对象的最大值 (宏常量)
其他整数类型的极限
PTRDIFF_MIN(C++11)
std::ptrdiff_t 类型对象的最小值 (宏常量)
PTRDIFF_MAX(C++11)
std::ptrdiff_t 类型对象的最大值 (宏常量)
SIZE_MAX(C++11)
std::size_t 类型对象的最大值 (宏常量)
SIG_ATOMIC_MIN(C++11)
std::sig_atomic_t 类型对象的最小值 (宏常量)
SIG_ATOMIC_MAX(C++11)
std::sig_atomic_t 类型对象的最大值 (宏常量)
WCHAR_MIN(C++11)
wchar_t 类型对象的最小值 (宏常量)
WCHAR_MAX(C++11)
wchar_t 类型对象的最大值 (宏常量)
WINT_MIN(C++11)
std::wint_t 类型对象的最小值 (宏常量)
WINT_MAX(C++11)
std::wint_t 类型对象的最大值 (宏常量)
整数常量的函数宏
INT8_CINT16_CINT32_CINT64_C
展开成拥有其实参所指定的值且类型分别为 int_least8_t、int_least16_t、int_least32_t、int_least64_t 的提升类型的整数常量表达式 (宏函数)
INTMAX_C
展开成拥有其实参所指定的值且类型为 intmax_t 的整数常量表达式 (宏函数)
UINT8_CUINT16_CUINT32_CUINT64_C
展开成拥有其实参所指定的值且类型分别为 uint_least8_t、uint_least16_t、uint_least32_t、uint_least64_t 的提升类型的整数常量表达式 (宏函数)
UINTMAX_C
展开成拥有其实参所指定的值且类型为 uintmax_t 的整数常量表达式 (宏函数)
概要
namespace std {
using int8_t = /* 有符号整数类型 */ ; // 可选
using int16_t = /* 有符号整数类型 */ ; // 可选
using int32_t = /* 有符号整数类型 */ ; // 可选
using int64_t = /* 有符号整数类型 */ ; // 可选
using int_fast8_t = /* 有符号整数类型 */ ;
using int_fast16_t = /* 有符号整数类型 */ ;
using int_fast32_t = /* 有符号整数类型 */ ;
using int_fast64_t = /* 有符号整数类型 */ ;
using int_least8_t = /* 有符号整数类型 */ ;
using int_least16_t = /* 有符号整数类型 */ ;
using int_least32_t = /* 有符号整数类型 */ ;
using int_least64_t = /* 有符号整数类型 */ ;
using intmax_t = /* 有符号整数类型 */ ;
using intptr_t = /* 有符号整数类型 */ ; // 可选
using uint8_t = /* 无符号整数类型 */ ; // 可选
using uint16_t = /* 无符号整数类型 */ ; // 可选
using uint32_t = /* 无符号整数类型 */ ; // 可选
using uint64_t = /* 无符号整数类型 */ ; // 可选
using uint_fast8_t = /* 无符号整数类型 */ ;
using uint_fast16_t = /* 无符号整数类型 */ ;
using uint_fast32_t = /* 无符号整数类型 */ ;
using uint_fast64_t = /* 无符号整数类型 */ ;
using uint_least8_t = /* 无符号整数类型 */ ;
using uint_least16_t = /* 无符号整数类型 */ ;
using uint_least32_t = /* 无符号整数类型 */ ;
using uint_least64_t = /* 无符号整数类型 */ ;
using uintmax_t = /* 无符号整数类型 */ ;
using uintptr_t = /* 无符号整数类型 */ ; // 可选
}
/* 亦定义下列形式的宏:
INT_[FAST LEAST]{8 16 32 64}_MIN
[U]INT_[FAST LEAST]{8 16 32 64}_MAX
INT{MAX PTR}_MIN
[U]INT{MAX PTR}_MAX
{PTRDIFF SIG_ATOMIC WCHAR WINT}{_MAX _MIN}
SIZE_MAX
*/
/* 亦定义下列形式的函数式宏:
[U]INT{8 16 32 64 MAX}_C
*/
|